package me.leon.aop;

import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.tv1).setOnClickListener(this::aopHaha);
        findViewById(R.id.tv2).setOnClickListener(this::aopHehe);
        findViewById(R.id.tv3).setOnClickListener(this::aopJump);
    }

    @SingleClick(4000)
    public void aopHaha(View view) {
        MyLog.log("Hello aop");
    }

    public void aopHehe(View view) {
        MyLog.log("Hello aop 2");
    }
    public void aopJump(View view) {
        Intent starter = new Intent(this, MainActivityKt.class);
        startActivity(starter);
    }

    public static void start(Context context) {
        Intent starter = new Intent(context, MainActivity.class);
//        starter.putExtra();
        context.startActivity(starter);
    }

}
